package com.peixian.exception;

import com.peixian.enums.UserResultEnums;
import lombok.Data;

/**
 * 自定义基础异常，用于向上跑出可预知异常
 */
@Data
public class UserException extends BaseException {
    protected int code;
    protected String msg;

    public UserException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public UserException(UserResultEnums rs) {
        this.code = rs.getCode();
        this.msg = rs.getMsg();
    }
}